Apple APIs topic
Generating bindings for Apple APIs
It can be tricky to locate header files containing Apple's ObjC frameworks, and
the paths can vary between computers depending on which version of Xcode you are
using and where it is installed. So FFIgen provides the following variable
substitutions that can be used in the headers.entry-points list:
$XCODE: Replaced with the result ofxcode-select -p, which is the directory where Xcode's APIs are installed.$IOS_SDK: Replaced withxcrun --show-sdk-path --sdk iphoneos, which is the directory within$XCODEwhere the iOS SDK is installed.$MACOS_SDK: Replaced withxcrun --show-sdk-path --sdk macosx, which is the directory within$XCODEwhere the macOS SDK is installed.
For example:
headers:
entry-points:
- '$MACOS_SDK/System/Library/Frameworks/Foundation.framework/Headers/NSDate.h'
In the Dart API you can use these getters:
xcodePath, iosSdkPath, and macSdkPath.
Classes
- FfiGenerator Apple APIs Objective-C Memory Management Objective-C Method Filtering Dealing with OS Differences Objective-C Runtime Types Objective-C Threading Errors FAQ
-
The generator that generates bindings for
dart:ffifrom C and Objective-C headers.